#include "hluart.h"
#include <stdio.h>
#define def_val(x, Type) (*(Type *)(&(x)))
void main()
{
    Element elements[4];
    Element elements2[4];
    u8 buffer[1024] = {0};
    element_input(elements[0],T_FLOAT,3.1);
    // elements[0].type = T_FLOAT;
    // elements[0].size = type_get_size(elements[0].type);
    // element_set_data(elements[0], 3.1);
    write_buffer(buffer, 1, elements);
    for (int i = 0; i < 5; i++)
    {
        printf("%x ", buffer[i]);
    }
    printf("\n");
    read_buffer(buffer, get_elements_length(buffer, 5), elements2);
    printf("%f", def_val(elements2[0].data, float));
    printf("\n");
}